﻿using MESBaseis.Domain.BaseEntities;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MESBaseis.Domain.ZSH
{
    /// <summary>
    /// 工艺流程表
    /// </summary>
    public class ProcessFlow : BaseModel
    {
        /// <summary>
        /// 工艺流程编号
        /// </summary>
        [Required]
        [StringLength(50)]
        public string ProcessFlowNumber { get; set; } = string.Empty;

        /// <summary>
        /// 工艺流程名称
        /// </summary>
        [Required]
        [StringLength(200)]
        public string ProcessFlowName { get; set; } = string.Empty;

        /// <summary>
        /// 工序数量 (自动计算或手动维护)
        /// </summary>
        public int ProcessCount { get; set; }

        /// <summary>
        /// 负责人
        /// </summary>
        [StringLength(50)]
        public string? ResponsiblePerson { get; set; }

        /// <summary>
        /// 所属部门
        /// </summary>
        [StringLength(100)]
        public string? Department { get; set; }

        /// <summary>
        /// 状态 (启用/禁用)
        /// </summary>
        public bool IsActive { get; set; } = true;

        /// <summary>
        /// 备注
        /// </summary>
        [StringLength(500)]
        public string? Remarks { get; set; }

        /// <summary>
        /// 附件原始文件名
        /// </summary>
        [StringLength(255)]
        public string? AttachmentOriginalFileName { get; set; }

        /// <summary>
        /// 附件存储文件名
        /// </summary>
        [StringLength(255)]
        public string? AttachmentStoredFileName { get; set; }

        /// <summary>
        /// 附件文件路径
        /// </summary>
        [StringLength(500)]
        public string? AttachmentFilePath { get; set; }

        /// <summary>
        /// 附件文件大小（字节）
        /// </summary>
        public long? AttachmentFileSize { get; set; }

        /// <summary>
        /// 附件文件类型 (MIME类型)
        /// </summary>
        [StringLength(100)]
        public string? AttachmentContentType { get; set; }

        /// <summary>
        /// 附件备注
        /// </summary>
        [StringLength(500)]
        public string? AttachmentRemarks { get; set; }

        // 导航属性
        /// <summary>
        /// 工艺流程步骤集合
        /// </summary>
        public virtual ICollection<ProcessFlowStep> ProcessFlowSteps { get; set; } = new List<ProcessFlowStep>();
    }
}
